package com.fr.data;

import com.fr.base.FCloneable;
import com.fr.base.Nameable;
import com.fr.base.XMLable;
import com.fr.base.xml.XMLPrintWriter;
import com.fr.base.xml.XMLableReader;
import com.fr.report.io.xml.ReportXMLUtils;

public class NameSubmitJob
  implements XMLable, Nameable
{
  public static final String XML_TAG = "NameSubmitJob";
  private String name;
  private SubmitJob submitJob;

  public NameSubmitJob()
  {
  }

  public NameSubmitJob(String paramString, SubmitJob paramSubmitJob)
  {
    setName(paramString);
    setSubmitJob(paramSubmitJob);
  }

  public String getName()
  {
    return this.name;
  }

  public void setName(String paramString)
  {
    this.name = paramString;
  }

  public SubmitJob getSubmitJob()
  {
    return this.submitJob;
  }

  public void setSubmitJob(SubmitJob paramSubmitJob)
  {
    this.submitJob = paramSubmitJob;
  }

  public void writeXML(XMLPrintWriter paramXMLPrintWriter)
  {
    paramXMLPrintWriter.startTAG("NameSubmitJob").attr("name", getName());
    ReportXMLUtils.writeXMLable(paramXMLPrintWriter, this.submitJob, "SubmitJob");
    paramXMLPrintWriter.end();
  }

  public void readXML(XMLableReader paramXMLableReader)
  {
    if (paramXMLableReader.isAttr())
      setName(paramXMLableReader.getAttr("name"));
    else if ((paramXMLableReader.isChildNode()) && ("SubmitJob".equals(paramXMLableReader.getTagName())))
      setSubmitJob(ReportXMLUtils.readSubmitJob(paramXMLableReader));
  }

  public Object clone()
    throws CloneNotSupportedException
  {
    NameSubmitJob localNameSubmitJob = (NameSubmitJob)super.clone();
    if (this.submitJob != null)
      localNameSubmitJob.submitJob = ((SubmitJob)this.submitJob.clone());
    return localNameSubmitJob;
  }
}